﻿package Util 
{
	
	import flash.display.BitmapData;
	import flash.display.Graphics;
	import flash.geom.Matrix;
	
	/**
	 * ...
	 * @author Gregory Weir
	 */
	public class NamatjiraGraphics 
	{

		public static function drawSprite(g:Graphics, sprite:BitmapData, x:Number, y:Number, m:Matrix = null, scaleFactor:Number = 1 ):void
		{
			if (m == null)
				m = new Matrix();
			
			m.scale(scaleFactor, scaleFactor);
			m.translate(x, y);
			
			g.beginBitmapFill(sprite, m);
			g.drawRect(x, y, sprite.width * scaleFactor, sprite.height * scaleFactor);
			g.endFill();
		}
	}
	
}